package cn.petplatform.petback.controller.pet;

import cn.petplatform.annotations.LoginVerifyToken;
import cn.petplatform.annotations.PassToken;
import cn.petplatform.dto.ResponseDto;
import cn.petplatform.petback.service.pet.PetService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author LNL
 * @date 2021/6/4 15:08
 */
@RestController
@Api(tags = "宠物管理")
@RequestMapping("/pet")
public class PetController {

    @Autowired
    private PetService petService;

    @PassToken
    @GetMapping("/pets")
    @ApiOperation("获取所有宠物")
    public ResponseDto pets() {
        ResponseDto responseDto = petService.getPets();
        return responseDto;
    }

//    @LoginVerifyToken
    @PostMapping("/delete/{id}")
    @ApiOperation("删除宠物")
    public ResponseDto delete(@PathVariable("id") String id) {
        ResponseDto responseDto = petService.delete(id);
        return responseDto;
    }

}
